package com.tanhua.dubbo.mappers;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tanhua.model.domain.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface UserMapper extends BaseMapper<User> {
    @Update("Update tb_user set mobile = #{phone} where id = #{userId}")
    void updatePhone(@Param("userId") Long userId, @Param("phone") String phone);
    //查询当天新增的用户按时间
    @Select("select count(*) from tb_user where to_days(created) = to_days(now())")
    Integer addToday();
    @Select("select count(*) from tb_user where to_days(NOW()) - TO_DAYS(created) = 1")
    Integer addYesterDay();

}
